package com.homeinns.server.utils;

import com.homeinns.server.enums.ResultEnum;
import com.homeinns.server.vo.ResultVO;

public class ResultVOUtil {

    public static ResultVO success(Object o){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("请求成功");
        resultVO.setData(o);

        return resultVO;
    }

    public static ResultVO error(ResultEnum resultEnum){

        ResultVO resultVO=new ResultVO();
        resultVO.setCode(resultEnum.getCode());
        resultVO.setMsg("登录失败");
        return resultVO;
    }

    public static ResultVO success(){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("请求成功");
        return resultVO;
    }
}
